#include "app.h"
#include "timeout.h"
#include "key_process.h"
#include "key_scan.h"
#include "uart_process.h"
#include "uart_send.h"
#include "uart_decode.h"

void App_Init(void)
{
	SetSysClock(SYSCLK_SRC_HSI48M, 48000000);
	TIM1_Config_Irq();
	TimeOut_Det_Init();
	Key_Process_Init();
	Send_Init();
}


void App_Handle(void)
{
	Key_Handle(Key_Scan());
	if (TimeOut_Det_Check(&key_para.timeout_send)) {
		uart_flag.on_off = TRUE;
		Uart_Data_Pack(key_para.send_value);
		TimeOut_Record(&key_para.timeout_send, 50);
	}
}
